<template>
    <div class="indexSetting">
        <el-dialog
            title="指标参数配置"
            :visible.sync="visible"
            :show-close="false"
            width="650px"
            top="5vh"
            :close-on-click-modal="false"
            append-to-body
        >
            <div class="main">
                <el-collapse v-model="activeNames">
                    <el-collapse-item title="触发指标" name="1">
                        <div style="margin-left: 20%; margin-bottom: 10px">
                            <span>计算因子：</span>
                            <el-select v-model="ht.indexCalculationFactor" size="mini">
                                <el-option key="0" value="0" label="本年基金收益率（份额法）"></el-option>
                            </el-select>
                        </div>
                    </el-collapse-item>
                    <el-collapse-item title="触发条件" name="2">
                        <el-row class="row-style">
                            <el-col :span="4">类型：</el-col>
                            <el-col :span="7">连续N天：</el-col>
                            <el-col :span="7">日历类型：</el-col>
                        </el-row>
                        <el-row class="row-style">
                            <el-col :span="4">
                                <el-checkbox v-model="ht.decline" size="mini" true-label="1" false-label="0">下降</el-checkbox>
                            </el-col>
                            <el-col :span="7">
                                <el-input-number v-model="ht.declineDays1" size="mini" controls-position="right" :min="1" :max="7" />
                            </el-col>
                            <el-col :span="8">
                                <el-select v-model="ht.declineDateType1" size="mini" style="margin-left: 10px">
                                    <el-option key="1" value="1" label="交易日"></el-option>
                                </el-select>
                            </el-col>
                        </el-row>
                        <el-row class="row-style">
                            <el-col :span="4">
                                <el-checkbox v-model="ht.rise" size="mini" true-label="1" false-label="0">上升</el-checkbox>
                            </el-col>
                            <el-col :span="7">
                                <el-input-number v-model="ht.declineDays2" size="mini" controls-position="right" :min="1" :max="7" />
                            </el-col>
                            <el-col :span="8">
                                <el-select v-model="ht.declineDateType2" size="mini" style="margin-left: 10px">
                                    <el-option key="1" value="1" label="交易日"></el-option>
                                </el-select>
                            </el-col>
                        </el-row>
                        <el-row class="row-style">
                            <el-col :span="4">
                                <el-checkbox v-model="ht.maintain" size="mini" true-label="1" false-label="0">跟踪</el-checkbox>
                            </el-col>
                            <el-col :span="7">
                                <el-input-number v-model="ht.declineDays3" size="mini" controls-position="right" :min="1" :max="7" />
                            </el-col>
                            <el-col :span="8">
                                <el-select v-model="ht.declineDateType3" size="mini" style="margin-left: 10px">
                                    <el-option key="1" value="1" label="交易日"></el-option>
                                </el-select>
                            </el-col>
                        </el-row>
                        <el-row class="row-style">
                            <el-col :span="4">
                                <el-checkbox v-model="ht.restore" size="mini" true-label="1" false-label="0">恢复</el-checkbox>
                            </el-col>
                            <el-col :span="7">
                                <el-input-number v-model="ht.declineDays4" size="mini" controls-position="right" :min="1" :max="7" />
                            </el-col>
                            <el-col :span="8">
                                <el-select v-model="ht.declineDateType4" size="mini" style="margin-left: 10px">
                                    <el-option key="1" value="1" label="交易日"></el-option>
                                </el-select>
                            </el-col>
                        </el-row>
                        <el-row class="row-style">
                            <el-col :span="12">
                                <el-checkbox v-model="ht.backTrack" size="mini" true-label="1" false-label="0">往前追溯一个周期</el-checkbox>
                            </el-col>
                        </el-row>
                    </el-collapse-item>
                    <el-collapse-item title="触发区间" name="3">
                        <el-row class="row-style">
                            <el-col :span="4"> 区间控制值1： </el-col>
                            <el-col :span="10">
                                <el-input-number
                                    v-model="ht.intervalLower1"
                                    size="mini"
                                    style="width: 50%"
                                    :min="-99"
                                    :max="99"
                                    controls-position="right"
                                />
                                <el-button class="symbolBtn">%</el-button>
                                <el-select class="select-style" v-model="cType.typeLeft" placeholder="无" @change="changeTypeLeft">
                                    <el-option key="0" label="≤" value="0"></el-option>
                                    <el-option key="1" label="<" value="1"></el-option>
                                </el-select>
                                ~
                            </el-col>
                            <el-col :span="10">
                                <!-- <el-button class="symbolBtn">＜</el-button> -->
                                <el-select class="select-style" v-model="cType.typeRight" placeholder="无" @change="changeTypeRight">
                                    <el-option key="0" label="≤" value="0"></el-option>
                                    <el-option key="1" label="<" value="1"></el-option>
                                </el-select>
                                <el-input-number
                                    v-model="ht.intervalUpper1"
                                    size="mini"
                                    style="width: 50%"
                                    :min="-99"
                                    :max="99"
                                    controls-position="right"
                                />
                                <el-button class="symbolBtn">%</el-button>
                            </el-col>
                        </el-row>
                        <el-row class="row-style">
                            <el-col :span="4"> 区间控制值2： </el-col>
                            <el-col :span="10">
                                <el-input-number
                                    v-model="ht.intervalLower2"
                                    :disabled="ht.intervalLower1 == undefined || ht.intervalUpper1 == undefined"
                                    size="mini"
                                    style="width: 50%"
                                    :min="-99"
                                    :max="99"
                                    controls-position="right"
                                />
                                <el-button class="symbolBtn">%</el-button>
                                <el-select class="select-style" v-model="cType.typeLeft" placeholder="无" @change="changeTypeLeft">
                                    <el-option key="0" label="≤" value="0"></el-option>
                                    <el-option key="1" label="<" value="1"></el-option>
                                </el-select>
                                ~
                            </el-col>
                            <el-col :span="10">
                                <el-select class="select-style" v-model="cType.typeRight" placeholder="无" @change="changeTypeRight">
                                    <el-option key="0" label="≤" value="0"></el-option>
                                    <el-option key="1" label="<" value="1"></el-option>
                                </el-select>
                                <el-input-number
                                    v-model="ht.intervalUpper2"
                                    :disabled="ht.intervalLower1 == undefined || ht.intervalUpper1 == undefined"
                                    size="mini"
                                    style="width: 50%"
                                    :min="-99"
                                    :max="99"
                                    controls-position="right"
                                />
                                <el-button class="symbolBtn">%</el-button>
                            </el-col>
                        </el-row>
                        <el-row class="row-style">
                            <el-col :span="4"> 区间控制值3： </el-col>
                            <el-col :span="10">
                                <el-input-number
                                    v-model="ht.intervalLower3"
                                    :disabled="ht.intervalLower2 == undefined || ht.intervalUpper2 == undefined"
                                    size="mini"
                                    style="width: 50%"
                                    :min="-99"
                                    :max="99"
                                    controls-position="right"
                                />
                                <el-button class="symbolBtn">%</el-button>
                                <el-select class="select-style" v-model="cType.typeLeft" placeholder="无" @change="changeTypeLeft">
                                    <el-option key="0" label="≤" value="0"></el-option>
                                    <el-option key="1" label="<" value="1"></el-option>
                                </el-select>
                                ~
                            </el-col>
                            <el-col :span="10">
                                <el-select class="select-style" v-model="cType.typeRight" placeholder="无" @change="changeTypeRight">
                                    <el-option key="0" label="≤" value="0"></el-option>
                                    <el-option key="1" label="<" value="1"></el-option>
                                </el-select>
                                <el-input-number
                                    v-model="ht.intervalUpper3"
                                    :disabled="ht.intervalLower2 == undefined || ht.intervalUpper2 == undefined"
                                    size="mini"
                                    style="width: 50%"
                                    :min="-99"
                                    :max="99"
                                    controls-position="right"
                                />
                                <el-button class="symbolBtn">%</el-button>
                            </el-col>
                        </el-row>
                        <el-row class="row-style">
                            <el-col :span="4"> 区间控制值4： </el-col>
                            <el-col :span="10">
                                <el-input-number
                                    v-model="ht.intervalLower4"
                                    :disabled="ht.intervalLower3 == undefined || ht.intervalUpper3 == undefined"
                                    size="mini"
                                    style="width: 50%"
                                    :min="-99"
                                    :max="99"
                                    controls-position="right"
                                />
                                <el-button class="symbolBtn">%</el-button>
                                <el-select class="select-style" v-model="cType.typeLeft" placeholder="无" @change="changeTypeLeft">
                                    <el-option key="0" label="≤" value="0"></el-option>
                                    <el-option key="1" label="<" value="1"></el-option>
                                </el-select>
                                ~
                            </el-col>
                            <el-col :span="10">
                                <el-select class="select-style" v-model="cType.typeRight" placeholder="无" @change="changeTypeRight">
                                    <el-option key="0" label="≤" value="0"></el-option>
                                    <el-option key="1" label="<" value="1"></el-option>
                                </el-select>
                                <el-input-number
                                    v-model="ht.intervalUpper4"
                                    :disabled="ht.intervalLower3 == undefined || ht.intervalUpper3 == undefined"
                                    size="mini"
                                    style="width: 50%"
                                    :min="-99"
                                    :max="99"
                                    controls-position="right"
                                />
                                <el-button class="symbolBtn">%</el-button>
                            </el-col>
                        </el-row>
                        <el-row class="row-style">
                            <el-col :span="4"> 区间控制值5： </el-col>
                            <el-col :span="10">
                                <el-input-number
                                    v-model="ht.intervalLower5"
                                    :disabled="ht.intervalLower4 == undefined || ht.intervalUpper4 == undefined"
                                    size="mini"
                                    style="width: 50%"
                                    :min="-99"
                                    :max="99"
                                    controls-position="right"
                                />
                                <el-button class="symbolBtn">%</el-button>
                                <el-select class="select-style" v-model="cType.typeLeft" placeholder="无" @change="changeTypeLeft">
                                    <el-option key="0" label="≤" value="0"></el-option>
                                    <el-option key="1" label="<" value="1"></el-option>
                                </el-select>
                                ~
                            </el-col>
                            <el-col :span="10">
                                <el-select class="select-style" v-model="cType.typeRight" placeholder="无" @change="changeTypeRight">
                                    <el-option key="0" label="≤" value="0"></el-option>
                                    <el-option key="1" label="<" value="1"></el-option>
                                </el-select>
                                <el-input-number
                                    v-model="ht.intervalUpper5"
                                    :disabled="ht.intervalLower4 == undefined || ht.intervalUpper4 == undefined"
                                    size="mini"
                                    style="width: 50%"
                                    :min="-99"
                                    :max="99"
                                    controls-position="right"
                                />
                                <el-button class="symbolBtn">%</el-button>
                            </el-col>
                        </el-row>
                        <el-row class="row-style">
                            <el-col :span="4"> 区间控制值6： </el-col>
                            <el-col :span="10">
                                <el-input-number
                                    v-model="ht.intervalLower6"
                                    :disabled="ht.intervalLower5 == undefined || ht.intervalUpper5 == undefined"
                                    size="mini"
                                    style="width: 50%"
                                    :min="-99"
                                    :max="99"
                                    controls-position="right"
                                />
                                <el-button class="symbolBtn">%</el-button>
                                <el-select class="select-style" v-model="cType.typeLeft" placeholder="无" @change="changeTypeLeft">
                                    <el-option key="0" label="≤" value="0"></el-option>
                                    <el-option key="1" label="<" value="1"></el-option>
                                </el-select>
                                ~
                            </el-col>
                            <el-col :span="10">
                                <el-select class="select-style" v-model="cType.typeRight" placeholder="无" @change="changeTypeRight">
                                    <el-option key="0" label="≤" value="0"></el-option>
                                    <el-option key="1" label="<" value="1"></el-option>
                                </el-select>
                                <el-input-number
                                    v-model="ht.intervalUpper6"
                                    :disabled="ht.intervalLower5 == undefined || ht.intervalUpper5 == undefined"
                                    size="mini"
                                    style="width: 50%"
                                    :min="-99"
                                    :max="99"
                                    controls-position="right"
                                />
                                <el-button class="symbolBtn">%</el-button>
                            </el-col>
                        </el-row>
                    </el-collapse-item>
                </el-collapse>
                <div style="color: #9a9b9d">
                    <div>说明</div>
                    <div>1)下降:连续N天满足在同一区间且较上一次触发区间是下降的(区间控制值序号变大)，包括首次触发;</div>
                    <div>2)上升:连续N天满足在同一区间且较上一次触发区间是上升的(区间控制值序号变小);</div>
                    <div>3)跟踪:连续N天满足在同一区间且较上一次触发区间是来变动的(区间控制值序号不变);</div>
                    <div>4)恢复:连续N天满足不在任一区间。</div>
                </div>
            </div>
            <div slot="footer" class="dialog-footer">
                <el-button name="calcExtendCancel" @click="handelBtnClick('cancel')">取消</el-button>
                <el-button name="calcExtendConfirm" type="primary" @click="handelBtnClick('confirm')">确定</el-button>
            </div>
        </el-dialog>
    </div>
</template>
<script lang="ts">
import { accDiv, accMul } from '@/utils/tools';
import { Component, Vue, Prop, Watch } from 'vue-property-decorator';

@Component({
    name: 'HtItemCalcExtendModel',
    components: {},
})
export default class HtItemCalcExtendModel extends Vue {
    @Prop() visible;
    @Prop() data;
    @Prop() res;
    @Prop() branchNum;
    @Prop() onlyLook;

    private paramDatas: any = {};
    private activeNames = ['1', '2', '3', '4'];

    private ht = {
        indexCalculationFactor: '0',
        decline: '1', //  下降
        declineDays1: undefined, // 连续N天
        declineDateType1: '1', // 日历类型-0交易日
        rise: '0', // 上升
        declineDays2: undefined, // 连续N天
        declineDateType2: '1', // 日历类型-0交易日
        maintain: '0', // 跟踪
        declineDays3: undefined, // 连续N天
        declineDateType3: '1', // 日历类型-0交易日
        restore: '0', // 恢复
        declineDays4: undefined, // 连续N天
        declineDateType4: '1', // 日历类型-0交易日
        backTrack: '0', // 往前追溯一个周期

        intervalLower1: undefined, // 区间控制值1-下限
        intervalUpper1: undefined, // 区间控制值1-上限
        intervalLower2: undefined, // 区间控制值2-下限
        intervalUpper2: undefined, // 区间控制值2-上限
        intervalLower3: undefined, // 区间控制值3-下限
        intervalUpper3: undefined, // 区间控制值3-上限
        intervalLower4: undefined, // 区间控制值4-下限
        intervalUpper4: undefined, // 区间控制值4-上限
        intervalLower5: undefined, // 区间控制值5-下限
        intervalUpper5: undefined, // 区间控制值5-上限
        intervalLower6: undefined, // 区间控制值6-下限
        intervalUpper6: undefined, // 区间控制值6-上限
    };

    cType = {
        typeLeft: '0',
        typeRight: '1',
    };

    @Watch('res', { immediate: true, deep: true })
    handleData(newdata) {
        this.paramDatas = this.res;
        if (this.res.C_TRIGGER_FACTOR == '0') {
            this.ht.indexCalculationFactor = '0'; // 触发指标
            this.ht.decline = this.paramDatas['C_DECLINE']; // 是否下降
            this.ht.declineDays1 = this.paramDatas['D_DECLINE_DAYS'] == 'undefined' ? undefined : this.paramDatas['D_DECLINE_DAYS']; // 下降天数
            this.ht.declineDateType1 = '1'; // 日历类型
            this.ht.rise = this.paramDatas['C_RISE']; // 是否上升
            this.ht.declineDays2 = this.paramDatas['D_RISE_DAYS'] == 'undefined' ? undefined : this.paramDatas['D_RISE_DAYS']; // 上升天数
            this.ht.declineDateType2 = '1'; // 日历类型
            this.ht.maintain = this.paramDatas['C_MAINTAIN']; // 是否跟踪
            this.ht.declineDays3 = this.paramDatas['D_MAINTAIN_DAYS'] == 'undefined' ? undefined : this.paramDatas['D_MAINTAIN_DAYS']; // "跟踪天数"
            this.ht.declineDateType3 = '1'; // 日历类型
            this.ht.restore = this.paramDatas['C_RESTORE']; // 是否恢复
            this.ht.declineDays4 = this.paramDatas['D_RESTORE_DAYS'] == 'undefined' ? undefined : this.paramDatas['D_RESTORE_DAYS']; // "恢复天数"
            this.ht.declineDateType4 = '1'; // 日历类型
            this.ht.backTrack = this.paramDatas['C_BACKTRACK']; // 是否往前回溯一个周期

            this.ht.intervalLower1 = this.paramDatas['N_INTERVAL1_LOWER'] == '' ? undefined : this.paramDatas['N_INTERVAL1_LOWER']; // 区间1下限
            this.ht.intervalUpper1 = this.paramDatas['N_INTERVAL1_UPPER'] == '' ? undefined : this.paramDatas['N_INTERVAL1_UPPER']; // 区间1上限
            this.ht.intervalLower2 = this.paramDatas['N_INTERVAL2_LOWER'] == '' ? undefined : this.paramDatas['N_INTERVAL2_LOWER']; // 区间2下限
            this.ht.intervalUpper2 = this.paramDatas['N_INTERVAL2_UPPER'] == '' ? undefined : this.paramDatas['N_INTERVAL2_UPPER']; // 区间2上限
            this.ht.intervalLower3 = this.paramDatas['N_INTERVAL3_LOWER'] == '' ? undefined : this.paramDatas['N_INTERVAL3_LOWER']; // 区间3下限
            this.ht.intervalUpper3 = this.paramDatas['N_INTERVAL3_UPPER'] == '' ? undefined : this.paramDatas['N_INTERVAL3_UPPER']; // 区间3上限
            this.ht.intervalLower4 = this.paramDatas['N_INTERVAL4_LOWER'] == '' ? undefined : this.paramDatas['N_INTERVAL4_LOWER']; // 区间4下限
            this.ht.intervalUpper4 = this.paramDatas['N_INTERVAL4_UPPER'] == '' ? undefined : this.paramDatas['N_INTERVAL4_UPPER']; // 区间4上限
            this.ht.intervalLower5 = this.paramDatas['N_INTERVAL5_LOWER'] == '' ? undefined : this.paramDatas['N_INTERVAL5_LOWER']; // 区间5下限
            this.ht.intervalUpper5 = this.paramDatas['N_INTERVAL5_UPPER'] == '' ? undefined : this.paramDatas['N_INTERVAL5_UPPER']; // 区间5上限
            this.ht.intervalLower6 = this.paramDatas['N_INTERVAL6_LOWER'] == '' ? undefined : this.paramDatas['N_INTERVAL6_LOWER']; // 区间6下限
            this.ht.intervalUpper6 = this.paramDatas['N_INTERVAL6_UPPER'] == '' ? undefined : this.paramDatas['N_INTERVAL6_UPPER']; // 区间6上限
            this.cType.typeLeft = this.paramDatas['C_TYPE'];
            this.cType.typeRight = this.paramDatas['C_TYPE'] == '0' ? '1' : '0';
            for (let i = 1; i < 7; i++) {
                console.log(
                    'hzj==00',
                    this.ht['intervalLower' + i],
                    this.ht['intervalUpper' + i],
                    typeof this.ht['intervalLower' + i],
                    typeof this.ht['intervalUpper' + i]
                );
                if (this.ht['intervalLower' + i] != undefined) {
                    this.ht['intervalLower' + i] = accMul(this.ht['intervalLower' + i], 100);
                }
                if (this.ht['intervalUpper' + i] != undefined) {
                    this.ht['intervalUpper' + i] = accMul(this.ht['intervalUpper' + i], 100);
                }
            }
        }
    }

    get paramGroup() {
        return JSON.parse(JSON.stringify(this.data));
    }

    private handelBtnClick(type: string): void {
        if (type === 'cancel') {
            this.$emit('update:visible', false);
        }
        if (type === 'confirm') {
            if (!this.verifyData1()) {
                return;
            }
            if (!this.verifyData2()) {
                return;
            }

            let paramDatas = JSON.parse(JSON.stringify(this.paramDatas));
            paramDatas['C_TRIGGER_FACTOR'] = this.ht.indexCalculationFactor; // 触发指标
            paramDatas['C_DECLINE'] = this.ht.decline; // 是否下降
            paramDatas['D_DECLINE_DAYS'] = this.ht.declineDays1; // 下降天数
            paramDatas['C_DECLINE_DATE_TYPE'] = this.ht.declineDateType1; // 日历类型
            paramDatas['C_RISE'] = this.ht.rise; // 是否上升
            paramDatas['D_RISE_DAYS'] = this.ht.declineDays2; // 上升天数
            paramDatas['C_RISE_DATE_TYPE'] = this.ht.declineDateType2; // 日历类型
            paramDatas['C_MAINTAIN'] = this.ht.maintain; // 是否跟踪
            paramDatas['D_MAINTAIN_DAYS'] = this.ht.declineDays3; // "跟踪天数"
            paramDatas['C_MAINTAIN_DATE_TYPE'] = this.ht.declineDateType3; // 日历类型
            paramDatas['C_RESTORE'] = this.ht.restore; // 是否恢复
            paramDatas['D_RESTORE_DAYS'] = this.ht.declineDays4; // "恢复天数"
            paramDatas['C_RESTORE_DATE_TYPE'] = this.ht.declineDateType4; // 日历类型
            paramDatas['C_BACKTRACK'] = this.ht.backTrack; // 是否往前回溯一个周期

            paramDatas['N_INTERVAL1_LOWER'] = this.ht.intervalLower1; // 区间1下限
            paramDatas['N_INTERVAL1_UPPER'] = this.ht.intervalUpper1; // 区间1上限
            paramDatas['N_INTERVAL2_LOWER'] = this.ht.intervalLower2; // 区间2下限
            paramDatas['N_INTERVAL2_UPPER'] = this.ht.intervalUpper2; // 区间2上限
            paramDatas['N_INTERVAL3_LOWER'] = this.ht.intervalLower3; // 区间3下限
            paramDatas['N_INTERVAL3_UPPER'] = this.ht.intervalUpper3; // 区间3上限
            paramDatas['N_INTERVAL4_LOWER'] = this.ht.intervalLower4; // 区间4下限
            paramDatas['N_INTERVAL4_UPPER'] = this.ht.intervalUpper4; // 区间4上限
            paramDatas['N_INTERVAL5_LOWER'] = this.ht.intervalLower5; // 区间5下限
            paramDatas['N_INTERVAL5_UPPER'] = this.ht.intervalUpper5; // 区间5上限
            paramDatas['N_INTERVAL6_LOWER'] = this.ht.intervalLower6; // 区间6下限
            paramDatas['N_INTERVAL6_UPPER'] = this.ht.intervalUpper6; // 区间6上限
            paramDatas['C_TYPE'] = this.cType.typeLeft;
            for (let i = 1; i < 7; i++) {
                if (this.ht['intervalLower' + i] == undefined && this.ht['intervalUpper' + i] == undefined) {
                    for (let j = i + 1; j < 7; j++) {
                        paramDatas['N_INTERVAL' + j + '_LOWER'] = '';
                        paramDatas['N_INTERVAL' + j + '_UPPER'] = '';
                    }
                } else {
                    let lower = paramDatas['N_INTERVAL' + i + '_LOWER'];
                    let upper = paramDatas['N_INTERVAL' + i + '_UPPER'];
                    if (lower == 0) {
                        paramDatas['N_INTERVAL' + i + '_LOWER'] = lower;
                    } else {
                        paramDatas['N_INTERVAL' + i + '_LOWER'] = lower ? accDiv(lower, 100) : '';
                    }
                    if (upper == 0) {
                        paramDatas['N_INTERVAL' + i + '_UPPER'] = upper;
                    } else {
                        paramDatas['N_INTERVAL' + i + '_UPPER'] = upper ? accDiv(upper, 100) : '';
                    }
                }
            }
            let param = JSON.parse(JSON.stringify(paramDatas));
            let arr = [];
            for (const key in param) {
                let value1 = param[key] == undefined ? '' : param[key];
                console.log('hzj===', typeof param[key], param[key]);
                let data = key + ':' + value1;
                arr.push(data);
            }
            // return
            this.$emit('handleParam', arr.join(','), this.branchNum);
        }
    }
    // 检测是否设置完整
    private verifyData1() {
        if (this.ht.decline == '1' && (this.ht.declineDays1 == '0' || this.ht.declineDays1 == undefined || this.ht.declineDays1 == 'undefined')) {
            this.yh_message_warn('下降连续天数需满足大于等于1或者小于等于7！');
            return false;
        }
        if (this.ht.rise == '1' && (this.ht.declineDays2 == '0' || this.ht.declineDays2 == undefined || this.ht.declineDays2 == 'undefined')) {
            this.yh_message_warn('上升连续天数需满足大于等于1或者小于等于7！');
            return false;
        }
        if (this.ht.maintain == '1' && (this.ht.declineDays3 == '0' || this.ht.declineDays3 == undefined || this.ht.declineDays3 == 'undefined')) {
            this.yh_message_warn('跟踪连续天数需满足大于等于1或者小于等于7！');
            return false;
        }
        if (this.ht.restore == '1' && (this.ht.declineDays4 == '0' || this.ht.declineDays4 == undefined || this.ht.declineDays4 == 'undefined')) {
            this.yh_message_warn('恢复连续天数需满足大于等于1或者小于等于7！');
            return false;
        }
        if (this.ht.intervalLower1 == undefined && this.ht.intervalUpper1 == undefined) {
            this.yh_message_warn('区间控制值1设置不可为空！');
            return false;
        }
        // if (this.ht.intervalLower1 == undefined && this.ht.intervalUpper1 != undefined) {
        //     this.yh_message_warn('区间控制值1设置不完整！');
        //     return false;
        // }
        // if (this.ht.intervalLower1 != undefined && this.ht.intervalUpper1 == undefined) {
        //     this.yh_message_warn('区间控制值1设置不完整！');
        //     return false;
        // }
        // if (this.ht.intervalLower2 == undefined && this.ht.intervalUpper2 != undefined) {
        //     this.yh_message_warn('区间控制值2设置不完整！');
        //     return false;
        // }
        // if (this.ht.intervalLower2 != undefined && this.ht.intervalUpper2 == undefined) {
        //     this.yh_message_warn('区间控制值2设置不完整！');
        //     return false;
        // }
        // if (this.ht.intervalLower3 == undefined && this.ht.intervalUpper3 != undefined) {
        //     this.yh_message_warn('区间控制值3设置不完整！');
        //     return false;
        // }
        // if (this.ht.intervalLower3 != undefined && this.ht.intervalUpper3 == undefined) {
        //     this.yh_message_warn('区间控制值3设置不完整！');
        //     return false;
        // }
        // if (this.ht.intervalLower4 == undefined && this.ht.intervalUpper4 != undefined) {
        //     this.yh_message_warn('区间控制值4设置不完整！');
        //     return false;
        // }
        // if (this.ht.intervalLower4 != undefined && this.ht.intervalUpper4 == undefined) {
        //     this.yh_message_warn('区间控制值4设置不完整！');
        //     return false;
        // }
        // if (this.ht.intervalLower5 == undefined && this.ht.intervalUpper5 != undefined) {
        //     this.yh_message_warn('区间控制值5设置不完整！');
        //     return false;
        // }
        // if (this.ht.intervalLower5 != undefined && this.ht.intervalUpper5 == undefined) {
        //     this.yh_message_warn('区间控制值5设置不完整！');
        //     return false;
        // }
        // if (this.ht.intervalLower6 == undefined && this.ht.intervalUpper6 != undefined) {
        //     this.yh_message_warn('区间控制值6设置不完整！');
        //     return false;
        // }
        // if (this.ht.intervalLower6 != undefined && this.ht.intervalUpper6 == undefined) {
        //     this.yh_message_warn('区间控制值6设置不完整！');
        //     return false;
        // }
        return true;
    }
    // 检测下限不可大于上限
    private verifyData2() {
        for (let i = 1; i < 7; i++) {
            if (this.ht['intervalLower' + i] >= this.ht['intervalUpper' + i]) {
                this.yh_message_warn('区间控制值' + i + '下限必须小于上限！');
                return false;
            }
        }
        for (let i = 1; i < 7; i++) {
            console.log('===123', this.ht['intervalUpper' + (i + 1)], typeof this.ht['intervalUpper' + (i + 1)]);
            if (this.ht['intervalLower' + i] != this.ht['intervalUpper' + (i + 1)] && this.ht['intervalUpper' + (i + 1)] != undefined) {
                this.yh_message_warn('区间控制值' + (i + 1) + '上限必须等于区间控制值' + i + '下限！');
                return false;
            }
        }
        return true;
    }
    // 左闭右开
    changeTypeLeft(param) {
        this.cType.typeLeft = param;
        if (param === '0') {
            this.cType.typeRight = '1';
        } else if (param === '1') {
            this.cType.typeRight = '0';
        }
    }
    // 左开右闭
    changeTypeRight(param) {
        this.cType.typeRight = param;
        if (param === '0') {
            this.cType.typeLeft = '1';
        } else if (param === '1') {
            this.cType.typeLeft = '0';
        }
    }
}
</script>
<style lang="scss" scoped>
.el-input {
    display: inline;
    /deep/ .el-input__inner {
        width: 223px;
    }
}
.symbolBtn {
    padding: 0px;
    height: 28px;
}
.row-style {
    margin-bottom: 10px;
}
/deep/ .el-dialog .el-dialog__body {
    max-height: 80vh !important;
}
/deep/ .el-checkbox__inner {
    border: 2px solid #51a7ff;
}
/deep/ .el-collapse-item__content {
    padding-bottom: 0px;
}
.select-style {
    width: 20%;
    display: inline-block;
}
.select-style /deep/ .el-input__icon {
    display: none;
}
.select-style /deep/ .el-input--suffix .el-input__inner {
    padding: 0 15px;
    height: 28px;
    text-align: center;
}
</style>
